import { request } from '@/utils/request';

export const createGoodsSource = async (data) => {
  return request({
    url: '/queue/goods-source/create',
    method: 'POST',
    data
  });
};

export const updateGoodsSource = async (data) => {
  return request({
    url: '/queue/goods-source/update',
    method: 'PUT',
    data
  });
};

export const closeGoodsSource = async (data) => {
  return request({
    url: '/queue/goods-source/close',
    method: 'PUT',
    data
  });
};

export const getGoodsSourceByPlanId = async (params) => {
  return request({
    url: '/queue/goods-source/getByPlanId',
    method: 'GET',
    params
  });
};

export function getLoadLists(params) {
  return request({
    url: '/queue/load-site-mgr/get-simple-list',
    method: 'GET',
    params
  });
}

export function getProductByPurchaserId(params) {
  return request({
    url: '/queue/supplier-product/getByPurchaserId',
    method: 'GET',
    params
  });
}
export function getAddress() {
  return request({
    url: '/system/tenant/get-address',
    method: 'GET'
  });
}

// 详情
export function getTransportDetail(id) {
  return request({
    url: '/queue/transport-plan/get?id=' + id,
    headers: {
      isToken: true
    },
    method: 'GET'
  });
}
